package kgc.crm.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import kgc.crm.enums.UserStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.util.Date;

/**
    * 用户表
    */

@Data

@TableName(value = "kgc_crm_admin_user")
public class User implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "user_id", type = IdType.AUTO)
    private Long userId;

    /**
     * 用户名
     */
    @TableField(value = "username")
    private String username;

    /**
     * 密码
     */
    @TableField(value = "password")
    private String password;

    /**
     * 安全符
     */
    @TableField(value = "salt")
    private String salt;

    /**
     * 头像
     */
    @TableField(value = "img")
    private String img;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 真实姓名
     */
    @TableField(value = "realname")
    private String realname;

    /**
     * 员工编号
     */
    @TableField(value = "num")
    private String num;

    /**
     * 手机号
     */
    @TableField(value = "mobile")
    private String mobile;

    /**
     * 邮箱
     */
    @TableField(value = "email")
    private String email;

    /**
     * 0 未选择 1 男 2 女 
     */
    @TableField(value = "sex")
    private Integer sex;

    /**
     * 部门
     */
    @TableField(value = "dept_id")
    private Integer deptId;

    /**
     * 岗位
     */
    @TableField(value = "post")
    private String post;

    /**
     * 状态,0禁用,1正常,2未激活
     */
    @TableField(value = "status")
    private UserStatusEnum userStatusEnum;

    /**
     * 直属上级ID
     */
    @TableField(value = "parent_id")
    private Long parentId;

    /**
     * 最后登录时间
     */
    @TableField(value = "last_login_time")
    private Date lastLoginTime;

    /**
     * 最后登录IP 注意兼容IPV6
     */
    @TableField(value = "last_login_ip")
    private String lastLoginIp;

    public static final String COL_USER_ID = "user_id";

    public static final String COL_USERNAME = "username";

    public static final String COL_PASSWORD = "password";

    public static final String COL_SALT = "salt";

    public static final String COL_IMG = "img";

    public static final String COL_CREATE_TIME = "create_time";

    public static final String COL_REALNAME = "realname";

    public static final String COL_NUM = "num";

    public static final String COL_MOBILE = "mobile";

    public static final String COL_EMAIL = "email";

    public static final String COL_SEX = "sex";

    public static final String COL_DEPT_ID = "dept_id";

    public static final String COL_POST = "post";

    public static final String COL_STATUS = "status";

    public static final String COL_PARENT_ID = "parent_id";

    public static final String COL_LAST_LOGIN_TIME = "last_login_time";

    public static final String COL_LAST_LOGIN_IP = "last_login_ip";
}